package cn.mingfancloud.基础知识.字符串;

public class StringBuilderDemo {
    public static void main(String[] args) {
        StringBuilder sbd = new StringBuilder();
        System.out.println("sbd的原值为空");
        sbd.append("我是StringBuilder类");
        System.out.println("sbd追加字符串：" + sbd);
        int length = sbd.length();
        System.out.println("sbd的长度为：" + length);
        sbd = sbd.insert(length - 1, "123456");
        System.out.println("插入字符串：" + sbd);
        sbd = sbd.delete(sbd.length() - 1, sbd.length());
        System.out.println("删除最后一个字：" + sbd);
        sbd = sbd.reverse();
        System.out.println("反序输出：" + sbd);
    }
}
